package com.scjp_Java6.Static;

/**implementare counter pentru instantele clasei
 * @author adumitrescu
 *
 */
public class Frog {
	static int frogCount=0;	//Declare and initialize static variable
	
	/**constructorul clasei Frog() initializeaza cu 1 frogCount
	 * de fiecare data cand este chemata.
	 * In acest caz frogCount fiind un field static pastreaza ultima 
	 * valoare atribuita.
	 */
	public Frog(){
		frogCount+=1;	//modify the value in the constructor	
	}
	public static void main(String[] args) {
		new Frog();
		new Frog();
		new Frog();
		new Frog();
		System.out.println("Frog count in now "+frogCount);
	}

}
